home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2 Examples.sit
/
Raven 1.2 Examples
/
Skeleton
/
Source
/
App.cpp
next >
Wrap
Text File
|
1997-02-06
|
3KB
|
142 lines
/*
* File: App.cpp
* Summary: Application object.
* Written by: Jesse Jones
*
* Copyright ゥ 1996 Jesse Jones. All Rights Reserved.
*
* Change History (most recent first):
*
* <-> 5/25/96 JDJ Created
*/
#include "App.h"
#include <ZDialogUtils.h>
#include <ZWindowMenuMgr.h>
#include "Doc.h"
// ===================================================================================
// class CApplication
// ===================================================================================
//---------------------------------------------------------------
//
// CApplication::~CApplication
//
//---------------------------------------------------------------
CApplication::~CApplication()
{
PRECONDITION(true);
}
//---------------------------------------------------------------
//
// CApplication::CApplication
//
//---------------------------------------------------------------
CApplication::CApplication()
{
// ・・・ハThese two data members belong to TDocApplication. You
// ・・・ハneed to change them to your document's type so that
// ・・・ハTDocApplication can open the correct files.
mNumFileTypes = 1;
mFileTypes[0] = 'DATA';
// POSTCONDITION(true); // wait till HandleInit is called (by Run)
}
#pragma mark ハ
//---------------------------------------------------------------
//
// CApplication::OnInit
//
//---------------------------------------------------------------
void CApplication::OnInit()
{
Inherited::OnInit();
TWindowMenuMgr::Init();
}
//---------------------------------------------------------------
//
// CApplication::OnQuit
//
//---------------------------------------------------------------
void CApplication::OnQuit()
{
TWindowMenuMgr::Terminate();
Inherited::OnQuit();
}
//---------------------------------------------------------------
//
// CApplication::OnAboutBox
//
//---------------------------------------------------------------
void CApplication::OnAboutBox()
{
(void) DoAlert(256);
}
//---------------------------------------------------------------
//
// CApplication::OnCreateDoc
//
//---------------------------------------------------------------
TDocument* CApplication::OnCreateDoc()
{
CDocument* doc = new CDocument(this);
// Documents are reference counted and are created with their
// ref count being zero. TDocWindow dtor decrements its document's
// reference count. If there are no other references to the
// document the document is deleted.
(void) TWindow::Create(256, doc);
return doc;
}
//---------------------------------------------------------------
//
// CApplication::OnMenuCommand
//
//---------------------------------------------------------------
bool CApplication::OnMenuCommand(const MenuCommand& command)
{
bool handled = false;
if (mQuitting || !TWindowMenuMgr::Instance()->HandleMenuCommand(command))
handled = Inherited::OnMenuCommand(command);
return handled;
}
//---------------------------------------------------------------
//
// CApplication::OnCommandStatus
//
//---------------------------------------------------------------
bool CApplication::OnCommandStatus(const MenuCommand& command, SCommandStatus& status)
{
bool handled = false;
if (mQuitting || !TWindowMenuMgr::Instance()->HandleCommandStatus(command, status))
handled = Inherited::OnCommandStatus(command, status);
return handled;
}